from selenium.webdriver.common.by import By

from Page.Page import Page
import unittest,time
from selenium import webdriver
from ddt import ddt,file_data

# @ddt
class Case(unittest.TestCase):
    def setUp(self):
        self.driver=webdriver.Edge()
        self.driver.maximize_window()
        print("开始")
    def tearDown(self):
        self.driver.close()
        print('结束')
    # @file_data(r'D:\AMuaaaaa\Mupycharm\mu\gao6_2211A\poMoni2\Data\login.json')
    def test_001_login(self):
        po=Page(self.driver)
        po.open_url('http://localhost:8081/')
        po.djlogin()
        time.sleep(2)
        po.username('admin')
        time.sleep(2)
        po.password('123')
        time.sleep(2)
        po.djtj()
        time.sleep(2)
        po.queren()
        time.sleep(2)

    def test_002_ChaXun(self):
        self.test_001_login()
        po=Page(self.driver)
        po.djlist()
        time.sleep(2)
        yuqi=po.xm()
        jieguo='员工姓名'
        self.assertEqual(yuqi,jieguo)
        time.sleep(2)
        po.shu1list('小黑')
        time.sleep(2)
        po.djsou()
        time.sleep(2)


if __name__ == '__main__':
    unittest.main()